package com.beyondbit.hr.core.dao;

import com.beyondbit.hr.api.dto.request.OrgUserQueryReq;
import com.beyondbit.hr.core.entity.OrgUser;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;

import java.util.Date;
import java.util.List;

@Mapper
public interface OrgUserMapper {

    @Results(
         id = "orgUser",
            value ={
                    @Result(id=true, property="id",column="ID",javaType=Integer.class,jdbcType= JdbcType.INTEGER),
                    @Result(property="orgId",column="OrgId",javaType=String.class,jdbcType= JdbcType.INTEGER),
                    @Result(property="userGuid",column="UserGuid",javaType=String.class,jdbcType= JdbcType.VARCHAR),
                    @Result(property="isMainOrg",column="isMainOrg",javaType=Boolean.class,jdbcType= JdbcType.INTEGER),
                    @Result(property="postCode",column="PostCode",javaType=String.class,jdbcType= JdbcType.VARCHAR),
                    @Result(property="postName",column="PostName",javaType=String.class,jdbcType= JdbcType.VARCHAR),
                    @Result(property="createTime",column="CreateTime",javaType= Date.class,jdbcType= JdbcType.TIMESTAMP),
                    @Result(property="createUid",column="CreateUid",javaType=String.class,jdbcType= JdbcType.VARCHAR),
                    @Result(property="createUName",column="CreateUName",javaType=String.class,jdbcType= JdbcType.VARCHAR),
                    @Result(property="isDelete",column="IsDelete",javaType=Boolean.class,jdbcType= JdbcType.INTEGER),
                    @Result(property="deleteTime",column="DeleteTime",javaType=Date.class,jdbcType= JdbcType.TIMESTAMP),
                    @Result(property="deleteUid",column="DeleteUid",javaType=String.class,jdbcType= JdbcType.VARCHAR),
            }
    )
    @SelectProvider(type = OrgUserSqlProvider.class)
    List<OrgUser> findOrgUser(@Param("req")OrgUserQueryReq req);
}
